import cv2
import mycv
import numpy as np


img = cv2.imread('/media/fang/TOSHIBA EXT/项目相关/G410D/G410D视频分析记录的一些数据/0623_multiscale/d_00276_1_41.jpg')

idx = [477, 99, 80, 100]

ROI_1_x = idx[0]
ROI_1_y = idx[1]
ROI_1_w = (600 - ROI_1_x - 1) % 300
ROI_1_h = idx[3] * 0.5


# img = cv2.resize(img, (100, 50))

mask_red = mycv.filter_out_black(img)
img_vstack = np.vstack((img, mask_red[0], mask_red[1]))
# cv2.imshow('img_vstack', mycv.get_vstack_src_maskred_red_img(img))
# cv2.imshow('black', img_vstack)
# cv2.waitKey(0)
cv2.imwrite('/media/fang/Samsung USB/G410D-0623/G410D-0623/tsr/img/Europe/edge/d_00276_1_41_vstack.jpg', img_vstack)